<!-- Top Container Start -->
<div id="top_container"> 
	<div class="breadcrumbs"> 
		<h2><span>
			<a href="<?php echo category_url($cate->cat_code); ?>"><?php echo $cate->cat_name; ?></a>
		</span> 
		</h2>
	</div>
	
	<!-- home-position1 Start -->

	<?php 
	
		$cate_widget = get_widgets('mid');
		//if (isset($subcates) && $subcates) { 
		//Load wiget 
		if ($cate_widget) foreach ($cate_widget as $widget) {
			$config = array();
			$config = json_decode($widget->MPOS_CONFIG, true);
			if ($widget->MOD_NAME == 'category_module') {
				if (isset($subcates) &&empty($subcates))  // da het cat de show;
					continue;
				$current_sub_cate = array_shift($subcates);
				
				//change config to load widget;
				
				$config['cateid'] = $current_sub_cate->cat_id;
				$config['link'] = category_url($current_sub_cate->cat_code);
				//$widget->MPOS_CONFIG = json_encode($config);
				
			}
			$config ['widget_title']  = $widget->MPOS_TITLE;
			$config ['widget_id']  = $widget->MPOS_ID;
			$config ['widget_layout']  = $widget->MPOS_LAYOUT;
				
			module_instance()->load->model($widget->MOD_CLASS);
			module_instance()->{$widget->MOD_NAME}->run($config);
		}
	//}
?>
	<!-- home-position1 End --> 

	<div class="clear"></div>
</div>

